package com.salesmonitoring.accounts.view;

import java.awt.Font;

import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JTextField;
import javax.swing.SwingConstants;

@SuppressWarnings("serial")
public class AccountSettingsUI extends JFrame {

	private JPanel formPanel;
	private JLabel lblAU, lblUsername, lblPassword, lblConfirmPassword,
			lblName, lblRole, lblWarehouse, lblEmail, lblContactNo;
	
	private JTextField usernameTextField, contactNoTextField, nameTextField,
			emailTextField;

	private JPasswordField passwordField, confirmPasswordField;
	private JComboBox roleComboBox, warehouseComboBox;
	private JButton saveSettingsButton;

	public AccountSettingsUI() {
		
		initialize();
	}

	public void initialize() {

		setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		setBounds(100, 100, 336, 360);

		formPanel = new JPanel();
		formPanel.setLayout(null);
		setContentPane(formPanel);

		lblAU = new JLabel("Account Settings");
		lblAU.setHorizontalAlignment(SwingConstants.CENTER);
		lblAU.setFont(new Font("Helvetica", Font.PLAIN, 20));
		lblAU.setBounds(6, 6, 324, 32);
		formPanel.add(lblAU);

		// ---Username
		lblUsername = new JLabel("Username");
		lblUsername.setFont(new Font("Helvetica", Font.PLAIN, 13));
		lblUsername.setBounds(6, 50, 95, 21);
		formPanel.add(lblUsername);

		usernameTextField = new JTextField();
		usernameTextField.setBounds(124, 45, 206, 28);
		usernameTextField.setColumns(10);
		usernameTextField.setEnabled(false);
		usernameTextField.setEditable(false);
		formPanel.add(usernameTextField);
		

		// ---Password
		lblPassword = new JLabel("Password");
		lblPassword.setFont(new Font("Helvetica", Font.PLAIN, 13));
		lblPassword.setBounds(6, 80, 95, 21);
		formPanel.add(lblPassword);

		passwordField = new JPasswordField();
		passwordField.setBounds(124, 75, 206, 28);
		formPanel.add(passwordField);

		// ---Confirm Password
		lblConfirmPassword = new JLabel("Confirm Password");
		lblConfirmPassword.setFont(new Font("Helvetica", Font.PLAIN, 13));
		lblConfirmPassword.setBounds(6, 110, 135, 21);
		formPanel.add(lblConfirmPassword);

		confirmPasswordField = new JPasswordField();
		confirmPasswordField.setBounds(124, 105, 206, 28);
		formPanel.add(confirmPasswordField);

		// ---Name
		lblName = new JLabel("Name");
		lblName.setFont(new Font("Helvetica", Font.PLAIN, 13));
		lblName.setBounds(6, 140, 95, 21);
		formPanel.add(lblName);

		nameTextField = new JTextField();
		nameTextField.setColumns(10);
		nameTextField.setBounds(124, 135, 206, 28);
		formPanel.add(nameTextField);

		// ---Role
		lblRole = new JLabel("Role");
		lblRole.setFont(new Font("Helvetica", Font.PLAIN, 13));
		lblRole.setBounds(6, 170, 95, 21);
		formPanel.add(lblRole);

		roleComboBox = new JComboBox();
		roleComboBox.setBounds(124, 167, 206, 27);
		roleComboBox.setEnabled(false);
		roleComboBox.setEditable(false);
		formPanel.add(roleComboBox);

		// ---Warehouse
		lblWarehouse = new JLabel("Warehouse");
		lblWarehouse.setFont(new Font("Helvetica", Font.PLAIN, 13));
		lblWarehouse.setBounds(6, 200, 95, 21);
		formPanel.add(lblWarehouse);

		warehouseComboBox = new JComboBox();
		warehouseComboBox.setEnabled(false);
		warehouseComboBox.setBounds(124, 197, 206, 27);
		warehouseComboBox.setEnabled(false);
		warehouseComboBox.setEditable(false);
		formPanel.add(warehouseComboBox);

		// ---Email
		lblEmail = new JLabel("E-mail");
		lblEmail.setFont(new Font("Helvetica", Font.PLAIN, 13));
		lblEmail.setBounds(6, 230, 95, 21);
		formPanel.add(lblEmail);

		emailTextField = new JTextField();
		emailTextField.setColumns(10);
		emailTextField.setBounds(124, 225, 206, 28);
		formPanel.add(emailTextField);

		// ---Contact No
		lblContactNo = new JLabel("Contact No.");
		lblContactNo.setFont(new Font("Helvetica", Font.PLAIN, 13));
		lblContactNo.setBounds(6, 260, 95, 21);
		formPanel.add(lblContactNo);

		contactNoTextField = new JTextField();
		contactNoTextField.setColumns(10);
		contactNoTextField.setBounds(124, 255, 206, 28);
		formPanel.add(contactNoTextField);

		saveSettingsButton = new JButton("Save");
		saveSettingsButton.setBounds(107, 295, 117, 29);
		formPanel.add(saveSettingsButton);
	}
}
